package de.unidue.masterproject.plugin.classes_literaturplugin;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

@DatabaseTable
public class ArticleQuote extends Quote{
	
	@DatabaseField
	private String pages;
	
	public ArticleQuote(Article reference, String content, String comment, String owner, boolean published, String pages){
		super(content, comment, owner, published);
		
		this.setReference(reference);
		this.pages = pages;
	}

	public String getPages() {
		return pages;
	}

	public void setPages(String pages) {
		this.pages = pages;
	}
	
	
	public String toString(){
		String s = "Page(s) "+pages+": "+getContent();
		
		if(s.length()>51){
			s = s.substring(0, 50)+"...";
		}
		
		if(isPublished()){
			s = "+ "+s;
		}
		else{
			s = "- "+s;
		}
		
		return s;
	}
	
	public ArticleQuote(){};
}
